package com.codechen.scaffold.news.controller;

import com.codechen.scaffold.common.domain.Result;
import com.codechen.scaffold.news.domain.entity.Categories;
import com.codechen.scaffold.news.domain.entity.News;
import com.codechen.scaffold.news.domain.request.NewsSaveRequest;
import com.codechen.scaffold.news.service.ICategoriesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Objects;

/**
 * @author : wuweihong
 * @desc : TODO  请填写你的功能描述
 * @date : 2025-06-15
 */


@RestController
@RequestMapping("/categories")
@Api(tags = "新闻分类")
public class NewsCategoryController {

	@Autowired
	private ICategoriesService categoriesService;

	@GetMapping("/list")
	@ApiOperation("分类列表")
	public Result<List<Categories>> list() {
		return Result.success(categoriesService.list());
	}

}
